#include<iostream>
#include<cstdio>
using namespace std;
inline int read(){
    int k=0;char f=1,c=getchar();
    for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
    for(;isdigit(c);c=getchar())k=k*10+c-'0';
    return k*f;
}
int n,v,w[100],dp[30000];
int main(){
	n=read();
	v=read();
	for(int i=1;i<=n;i++){
		w[i]=read();
		for(int j=v;j>=w[i];j--){
			dp[j]=max(dp[j],dp[j-w[i]]+w[i]);
		}
	}
	printf("%d",v-dp[v]);
}
